package com.wondersgroup.fjzlpt.tbxt.dao.impl.jc;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.repository.sql.bean.SQLBean;
import com.quick.framework.boot.repository.sql.bean.table.TableBean;
import com.quick.framework.boot.repository.sql.jdbcTemplate.impl.BaseJTDAOImpl;
import com.wondersgroup.fjzlpt.tbxt.dao.inter.jc.JcYbDao;

@Repository
public class JcYbDaoImpl extends BaseJTDAOImpl implements JcYbDao{

	@Override
	@Autowired
	@Qualifier("TB_TBXT_JC_ZHXX_YB")
	public void setTb(TableBean tb) {
		super.setTb(tb);
	}

	/**
	 * 查询某机构填报记录
	 * @param map
	 * @return
	 */
	@Override
	public JSONObject queryOne(Map<String, String> map) {
		StringBuffer sqlBuf = new StringBuffer();
		List<String> sqlParams = new ArrayList<String>();
		sqlBuf.append("select * from ").append(this.tb.getTableName()).append(" where NF = ? and YF = ? and YLJGID = ?");		
		sqlParams.add(map.get("NF"));
		sqlParams.add(map.get("YF"));
		sqlParams.add(map.get("YLJGID"));
		
		SQLBean bean = new SQLBean(sqlBuf.toString(), sqlParams.toArray());
		return super.queryOne(bean);
	}
	
	
}
